<{include file="header.html"}>

<script type="text/javascript">

	function validate()
	{
		var title = document.getElementById('TITLE');
		var time = document.getElementById('TIME');
		var price = document.getElementById('PRICE');
		var id_service_group = document.getElementById('ID_SERVICE_GROUP');
		var pos = document.getElementById('POS');

		// checking TITLE
		if(isEmptyTextBox(title, '<{$smarty.const._LB_NAME_IS_EMPTY|utf8_escape_js}>'))
			return false;

		if(!isValidLengthTextBox(title, <{$smarty.const.MAX_LENGTH_TITLE}>, '<{$smarty.const._LB_NAME_IS_TOO_LONG|utf8_escape_js}>')){
            return false;
        }
		if(isEmptyTextBox(time, '<{$smarty.const._MSG_TIME_INVALID|utf8_escape_js}>'))
			return false;
		if(isInvalidIntTextBox(time, '<{$smarty.const._MSG_TIME_INVALID|utf8_escape_js}>')){
			return false;
		}
		if(isInvalidFloatTextBox(price, '<{$smarty.const._MSG_PRICE_INVALID|utf8_escape_js}>')){
			return false;
		}
		if(isInvalidIntTextBox(pos, "The Postion must be integer number")){
			return false;
		}
		document.user_form.submit();
	}



</script>

		<div class="box_two_third">
			<div class="box_head"><{$smarty.const._LB_SERVICE_MANAGEMENT|utf8_escape_html}></div>
			<div class="box_content">
				<form enctype="multipart/form-data" action="<{$smarty.server.REQUEST_URI}>" method="post" name="user_form">
				<input type="hidden" id="ID" value="<{$service->ID}>"/>
				<input type="hidden" id="act" name="act" value="<{$smarty.const.ACT_VALID_EDIT}>"/>
				<table>
					<tr>
						<td ><{$smarty.const._LB_SERVICE_GROUP|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3">
							<select id="ID_SERVICE_GROUP" name="ID_SERVICE_GROUP">
								<{while $gService->fetch()}>
								<option value="<{$gService->ID}>" <{if $gService->ID == $service->ID_SERVICE_GROUP}>selected="selected"<{/if}>><{$gService->TITLE|utf8_escape_html}></option>
								<{/while}>
							</select>
						</td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_TITLE|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="TITLE" id="TITLE" type="text" value="<{$service->TITLE|utf8_escape_html}>" /></td>
					</tr>
					<tr>
						<td ><{$smarty.const._LB_TIME|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="TIME" id="TIME" type="text" value="<{$service->TIME|utf8_escape_html}>" /> (<{$smarty.const._LB_MINUTES|utf8_escape_html}>)</td>
					</tr>
					<tr>
						<td ><{$smarty.const._LB_PRICE|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="PRICE" id="PRICE" type="text" value="<{$service->PRICE|utf8_escape_html}>" /></td>
					</tr>
					<tr>
						<td ><{$smarty.const._LB_POSITION|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="POS" id="POS" type="text" value="<{$service->POS|utf8_escape_html}>" size="3" /></td>
					</tr>
					<tr>
						<td ><{$smarty.const._LB_CONTENT|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><textarea name="CONTENT" id="CONTENT" cols="60" rows="6" ><{$service->CONTENT|utf8_escape_html}></textarea></td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_DISABLED|utf8_escape_html}>&nbsp;:&nbsp;</td>
						<td colspan="3"><input type="checkbox" value="1" name="DISABLED" <{if $service->DISABLED}>checked<{/if}>/></td>
					</tr>
					<tr>
						  <td class="submit" colspan="4" style="padding-top:10px"><br />
								<a class="tribullet" href="<{$backlink}>"><{$smarty.const._LB_BACK}></a>
								<a class="tribullet" href="#" onclick="validate()"><{$smarty.const._LB_VALIDATE}></a>
							</td>
						</tr>

				</table>
				</form>

			</div>
		</div>
<{include file="footer.html"}>
